<?php
/*
Plugin Name: 0 Test
Plugin URI: http://wanwp.com
Description:
Author: 冰古
Version: 1.0
Author URI: http://bingu.net
License: GNU General Public License 2.0 http://www.gnu.org/licenses/gpl.html
 */

if ( !defined('WP_PLUGIN_URL') )
	define( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins' );                           //  plugin url

define('TEST_BASENAME', plugin_basename(__FILE__));
define('TEST_BASEFOLDER', plugin_basename(dirname(__FILE__)));
define('TEST_FILENAME', str_replace(TEST_BASEFOLDER.'/', '', plugin_basename(__FILE__)));

if (is_admin()){
    add_action('admin_menu', 'test_add_setting_page');

    function test_add_setting_page() {
        add_options_page('TEST Setting', 'TEST Setting', 8, __FILE__, 'test_setting_page');
    }

    function test_setting_page() {
        echo <<<TABS
<div id="wrapper">
    <ul>
        <li><a href="#setting"><span>设置</span></a></li>
        <li><a href="#uninstall"><span>卸载</span></a></li>
    </ul>
    <div id="setting">
        <p>这里就是设置内容</p>
    </div>
    <div id="uninstall">
        <p>这里是卸载内容</p>
    </div>
</div>
TABS;
    }
    
    wp_enqueue_script('jquery');
    wp_enqueue_script('jquery-ui-core');
    wp_enqueue_script('jquery-ui-tabs');

    add_action('admin_footer', 'test_setting_js');
    function test_setting_js() {
        echo <<<JS
<script type="text/javascript">
jQuery(document).ready(function(){
    jQuery("#wrapper").tabs();
});
</script>
JS;
    }

    add_action('admin_head', 'test_setting_css');
    function test_setting_css() {
        echo '<link type="text/css" href="http://jqueryui.com/latest/themes/base/ui.all.css" rel="stylesheet" />';
    }
}
/* EOF send-post.php */